package com.example.springboot.service;

import com.example.springboot.entity.announcements;
import com.example.springboot.mapper.AnnouncementMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class  AnnouncementService {

    @Autowired
    private AnnouncementMapper announcementMapper;


    public List<announcements> getAllAnnouncements() {
        return announcementMapper.getAllAnnouncements();
    }


    public announcements getAnnouncementById(int announcementId) {
        return announcementMapper.getAnnouncementById(announcementId);
    }


    public void addAnnouncement(announcements announcement) {
        announcementMapper.addAnnouncement(announcement);
    }


    public void updateAnnouncement(announcements announcement) {
        announcementMapper.updateAnnouncement(announcement);
    }


    public void deleteAnnouncement(int announcementId) {
        announcementMapper.deleteAnnouncement(announcementId);
    }
}
